import java.util.Random;
import java.util.Scanner;
public class exp1 {
    public static void main(String[] args) {
        Random rd = new Random();
        int a = rd.nextInt(7);
        System.out.println("请猜一个数，7以内。");
        Scanner input = new Scanner(System.in);
        int b = 0;
        do {
            b = input.nextInt();
            while (b > 7 || b < 1) {
                System.out.println("不在1-7之间，再输入一次：");
                b = input.nextInt();
            }
            if (b > a) {
                System.out.println("大了。");
            }
            if (b < a) {
                System.out.println("小了。");
            }
        } while (a != b);
        System.out.println("猜对了！");
    }
}
